var util = require('../../utils/util.js');
var ajax = require('../../utils/ajax.js');
var common = require('../../utils/common.js');
var PageBase = require('../../common/PageBase.js');
var app = getApp();

Page(common.extendPage(PageBase, {
  data: {
    receiveNotify:true
  },
  /**
   * 页面初始化
   */
  onLoad(options) {

  },
  /**
   * 切换消息
   */
  switch1Change(){
    this.setData({
      receiveNotify: !this.data.receiveNotify
    })
    if(!this.data.receiveNotify){
      wx.setStorageSync('refuseNotify', true);
    }else{
      wx.setStorageSync('refuseNotify', false);
    }
    console.log(wx.getStorageSync('refuseNotify'));
  },
  /**
   * 清除登录缓存
   */
  _jumpM(evt) {
    var {
      url
    } = evt.currentTarget.dataset;
    if (!!wx.getStorageSync('uid')) {
      wx.removeStorageSync('uid');
      wx.reLaunch({
        url
      })
    }else{
      util.tips('未检测到登录信息,无法退出登录');
    }
  }
}));